﻿using EkStudio.com.bean.xml.reflection;
using EkStudio.com.bean.xml.RootInterface;
using System.Collections.Generic;

namespace EkStudio.com.bean.xml.WorkFlow.Node
{
    public class WflowModuleNodeItem: BillUiFormatNode
    {

        #region 基础属性

        private string key = "";
        private string caption = "节点名称";
        private string nodeType = "";
        private string languageTexts = "";
        private string nextNode = "";
        private int left = 0;
        private int top = 0;
        private int width = 120;
        private int height = 60;

        #endregion


        private WflowNodeItemActivity  nodeFlowActivity = null;
        private WflowNodeItemCondition nodeFlowCondition = null;

        private List<WflowModuleNodeLine> lines = null;



        [Xml]
        public string Key
        {
            get
            {
                return key;
            }

            set
            {
                key = value;
            }
        }
        [Xml]
        public string Caption
        {
            get
            {
                return caption;
            }

            set
            {
                caption = value;
            }
        }
        [Xml]
        public string NodeType
        {
            get
            {
                return nodeType;
            }

            set
            {
                nodeType = value;
            }
        }
        [Xml]
        public string LanguageTexts
        {
            get
            {
                return languageTexts;
            }

            set
            {
                languageTexts = value;
            }
        }
        [Xml]
        public string NextNode
        {
            get
            {
                return nextNode;
            }

            set
            {
                nextNode = value;
            }
        }
        [Xml]
        public int Left
        {
            get
            {
                return left;
            }

            set
            {
                left = value;
            }
        }
        [Xml]
        public int Top
        {
            get
            {
                return top;
            }

            set
            {
                top = value;
            }
        }
        [Xml]
        public int Width
        {
            get
            {
                return width;
            }

            set
            {
                width = value;
            }
        }
        [Xml]
        public int Height
        {
            get
            {
                return height;
            }

            set
            {
                height = value;
            }
        }

        [XmlElement]
        public WflowNodeItemActivity NodeFlowActivity
        {
            get { return nodeFlowActivity; }
            set { nodeFlowActivity = value; }
        }
        [XmlElement]
        public WflowNodeItemCondition NodeFlowCondition
        {
            get { return nodeFlowCondition; }
            set { nodeFlowCondition = value; }
        }
        [XmlElement("line")]
        public List<WflowModuleNodeLine> Lines
        {
            get { return lines; }
            set { lines = value; }
        }


        [XmlTransient]
        public object ParentBean
        {
            get
            {
                return null;
            }

            set
            {
                
            }
        }

        public object Clone()
        {
            WflowModuleNodeItem clone = new WflowModuleNodeItem();
            clone.Key = key;
            clone.Caption = caption;
            clone.NodeType = nodeType;
            clone.NextNode = nextNode;
            clone.Left = left;
            clone.Top = top;
            clone.Width = width;
            clone.Height = height;
            if (nodeFlowActivity != null) clone.NodeFlowActivity = nodeFlowActivity.Clone() as WflowNodeItemActivity;
            if (nodeFlowCondition != null) clone.NodeFlowCondition = nodeFlowCondition.Clone() as WflowNodeItemCondition;
            return clone;
        }

        public override string ToString()
        {
            return caption;
        }
    }

}
